package com.speljohan.rsbot.util;

public class GlobalConfiguration {
	public enum OperatingSystem {
		MAC, WINDOWS, LINUX, UNKNOWN
	}

	public static final String LOGO_PATH = "./Bot/com/speljohan/rsbot/images/logo.png";

	private static final OperatingSystem CURRENT_OS;

	static {
		final String os = System.getProperty("os.name");
		if (os.contains("Mac")) {
			CURRENT_OS = OperatingSystem.MAC;
		} else if (os.contains("Windows")) {
			CURRENT_OS = OperatingSystem.WINDOWS;
		} else if (os.contains("Linux")) {
			CURRENT_OS = OperatingSystem.LINUX;
		} else {
			CURRENT_OS = OperatingSystem.UNKNOWN;
		}
	}

	public static OperatingSystem getCurrentOperatingSystem() {
		return GlobalConfiguration.CURRENT_OS;
	}

	/**
	 * Check to see if the current operating system matches any from the
	 * arguments.
	 * 
	 * @param oses
	 *            operating systems to match
	 * @return true if any of the oses from parameters matches the current OS.
	 */
	public static boolean isOperatingSystem(final OperatingSystem... oses) {
		for (final OperatingSystem os : oses) {
			if (os == GlobalConfiguration.CURRENT_OS) {
				return true;
			}
		}
		return false;
	}
}
